from django.conf.urls.defaults import *
from django.views.generic.simple import redirect_to

import os.path

STATIC_ROOT = os.path.abspath(
	os.path.join(
		os.path.dirname(__file__),
		"static"
	)
)

urlpatterns = patterns('',
	(r'^settings/delete_directory/(?P<directory_index>\d+)$', 'views.delete_directory'),
	(r'^settings/add_directory$', 'views.add_directory'),
	(r'^settings$', 'views.settings'),
	(r'^update/start$', 'views.update_start'),
	(r'^update/status$', 'views.update_status'),
	(r'^update$', 'views.update'),
	(r'^movies/', include('pywebnmj.movies.urls')),
	(r'^static/(?P<path>.*)$', 'django.views.static.serve',
		{'document_root': STATIC_ROOT}
	),
	(r'^$', redirect_to, {'url' : '/movies'}),
)
